package com.dhecp.project.storage.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dhecp.common.annotation.Log;
import com.dhecp.common.annotation.RepeatSubmit;
import com.dhecp.common.core.domain.AjaxResult;
import com.dhecp.common.enums.BusinessType;
import com.dhecp.project.common.controller.BaseModuleController;
import com.dhecp.project.storage.service.OtherCostService;

/**
 * @program: kjecp
 * @description: 仓储 费用调整控制层
 * @author: hlf
 * @create: 2022-12-07 10:06
 */
@Controller
@RequestMapping("/storage/othercost")
public class OtherCostController extends BaseModuleController {

    @Autowired
    private OtherCostService otherCostService;

    @Log(title = "费用调整", businessType = BusinessType.UPDATE)
    @PostMapping("/editpost")
    @ResponseBody
    @RepeatSubmit
    public AjaxResult editSave(@RequestParam Map<String, Object> params) {
        params.put("moduleTable", "TCC_OtherCost");
        AjaxResult ajaxResult = new AjaxResult();
        try {
            ajaxResult = otherCostService.saveData(params);
        } catch (Exception e) {
            ajaxResult = AjaxResult.error(this.getExceptionMessage(e));
        }
        return ajaxResult;
    }
}